/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package warmachinesystem.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import warmachinesystem.TBFieldAllowanceDelta;
import warmachinesystem.WarmachineSystemPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>TB Field Allowance Delta</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link warmachinesystem.impl.TBFieldAllowanceDeltaImpl#getFieldAllowance <em>Field Allowance</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TBFieldAllowanceDeltaImpl extends BaseUnitTierElementImpl implements TBFieldAllowanceDelta {
	/**
	 * The default value of the '{@link #getFieldAllowance() <em>Field Allowance</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFieldAllowance()
	 * @generated
	 * @ordered
	 */
	protected static final String FIELD_ALLOWANCE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getFieldAllowance() <em>Field Allowance</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFieldAllowance()
	 * @generated
	 * @ordered
	 */
	protected String fieldAllowance = FIELD_ALLOWANCE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TBFieldAllowanceDeltaImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WarmachineSystemPackage.Literals.TB_FIELD_ALLOWANCE_DELTA;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getFieldAllowance() {
		return fieldAllowance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFieldAllowance(String newFieldAllowance) {
		String oldFieldAllowance = fieldAllowance;
		fieldAllowance = newFieldAllowance;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WarmachineSystemPackage.TB_FIELD_ALLOWANCE_DELTA__FIELD_ALLOWANCE, oldFieldAllowance, fieldAllowance));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_FIELD_ALLOWANCE_DELTA__FIELD_ALLOWANCE:
				return getFieldAllowance();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_FIELD_ALLOWANCE_DELTA__FIELD_ALLOWANCE:
				setFieldAllowance((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_FIELD_ALLOWANCE_DELTA__FIELD_ALLOWANCE:
				setFieldAllowance(FIELD_ALLOWANCE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_FIELD_ALLOWANCE_DELTA__FIELD_ALLOWANCE:
				return FIELD_ALLOWANCE_EDEFAULT == null ? fieldAllowance != null : !FIELD_ALLOWANCE_EDEFAULT.equals(fieldAllowance);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (fieldAllowance: ");
		result.append(fieldAllowance);
		result.append(')');
		return result.toString();
	}

} //TBFieldAllowanceDeltaImpl
